import {reactive,onMounted} from "vue";
import axios from 'axios'
export default function (){
    let dogList =reactive([
        'https:\\/\\/images.dog.ceo\\/breeds\\/pembroke\\/n02113023_1825.jpg'
    ])

   async function addDog ():void{
        try {
         let image = await  axios.get('https://dog.ceo/api/breed/pembroke/images/random')
            dogList.push(image.data.message)
        }catch (e) {
           alert(e.message)
        }
    }
    onMounted(()=>{
        addDog()
    })
    return {dogList,addDog}
}